package com.dmz.questysf.util;

import java.nio.charset.StandardCharsets;

/**
 * @author lee
 */
public class StringUtil {


    public static String AddZeroForNum(String str) {
        try {
            String a = new String(str.getBytes("GBK"), StandardCharsets.ISO_8859_1);
            int strLen = a.length();
            String c = "";
            if (strLen < 9) {
                c = "000" + strLen;
            } else if (strLen < 99) {
                c = "00" + strLen;
            } else if (strLen < 999) {
                c = "0" + strLen;
            } else {
                c = strLen + "";
            }
            return c;
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return "";
    }

}
